package cn.coisini.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xiangshaw
 * Description: Knife4j配置类
 */
@Configuration
public class Knife4jConfig {

    @Bean
    public OpenAPI coisiniBlogOpenApi() {
        return new OpenAPI()
                .info(new Info()
                        // 接口文档标题
                        .title("coisini-blog")
                        // 接口文档简介
                        .description("coisini-blog的接口文档")
                        // 接口文档版本
                        .version("0.0.1-SNAPSHOT")
                        // 开发者信息
                        .contact(new Contact().name("coisini.cn").email("coisini.xiang@foxmail.com"))
                )
                .externalDocs(new ExternalDocumentation()
                        .description("coisini-blog的接口文档")
                        .url("https://coisini.cn"));
    }
}